{% extends "test_app/base.html" %}

{% block content %}
  {% load comments %}
  <p>{{ object.contents }} by <strong>{{ object.owner }}</strong> on <strong>{{ object.date_posted }}</strong></p>
  
  {% get_comment_list for test_app.message object.pk as comment_list %}
    {% if comment_list %}
    <h2>Comments</h2>
    {% for comment in comment_list %}
      <h4>{{ comment.name|escape }} born on {{ comment.date_of_birth }} posted a comment on {{ comment.date_posted }}</h4>
      <p>{{ comment.comment|escape|urlizetrunc:"100"|linebreaks }}</p>
      <hr>
    {% endfor %}    
  {% endif %}
  <h2>Leave a comment</h2>
  {% render_comment_form for test_app.message object.pk %}
{% endblock %}

